1. Technical Field
The present invention relates to a buffer room logic for buffering data transmitted between a data storage device and a host, and in particular, to a buffer room logic and a method for controlling the same so as to prevent the loss of write data which turns out to be flawed during data write verification in a buffer memory.
2. Related Art
Various data storage devices have emerged with the advent of the information era. There are two groups of data storage devices: one includes a hard disk drive and a floppy disk drive, using a magnetic disk as the recording medium; the other includes a compact disk-recordable (CD-R) and a compact disk-rewritable (CD-RW), using an optical disk as a recording medium. These data storage devices receive data from a host, record the received data in a recording medium, and repeatedly reproduce the data.
Among data recording devices, the hard disk drive is most widely used as an auxiliary memory device for a computer system. The hard disk drive receives data from a host upon input of a data write command from the host, and stores the data in an interior buffer memory. Then, the data stored in the buffer memory is recorded on a disk by moving a head to an intended position, that is, a target sector in a target track on the disk. The hard disk drive has a buffer memory of an appropriate size to reduce asynchronization between data transfer from the host and data transfer to the disk, and also has a register called a buffer counter for indicating how much data remains in the buffer memory. The hard disk drive also has logic for determining, according to the value of the buffer counter, whether the buffer memory has room for receiving data from the host, or data to be recorded on the disk. Host data transfer and disk data transfer are controlled according to the state of the logic. Generally, this logic is termed a buffer room logic, and includes a host room logic and a disk room logic.
As described in more detail below, the buffer room logic can be enabled or disabled, as necessary. If the host interface disables the buffer room logic, a host data transfer is performed regardless of the value stored in the buffer counter. If the disk interface disables the buffer room logic, a disk data transfer is performed regardless of the value stored in the buffer counter. In either case, the value stored in the buffer counter is not altered. That is to say, the buffer room logic can be enabled or disabled by the host interface and the disk interface.
Upon input of a data write command from the host, both the host interface and the disk interface enable the buffer room logic, and data transferred via the host interface and the disk interface is immediately recorded. Therefore, the value stored in the buffer counter is dynamically altered when all of the data is transferred from the host and recorded on the disk.
A problem arises in that the buffer room logic cannot always be enabled if a data write verification process is to be performed in order to re-read recorded data and determine whether the re-read data is defective. This is due to the fact that the data should be replaced by the next data in a given buffer memory in order to transfer a large amount of data from the host and record the data on a disk. In this case, recorded data is likely to be overwritten by data successively transferred from the host. Thus, since data which turns out to be flawed during a data write verification process should be written again, the data should remain in the buffer memory.
This problem can be solved by setting the value of a maximum buffer counter to a value smaller than the size of the buffer memory, and thus an amount of data is recorded and read up to the size of the buffer memory less the value stored in the maximum buffer counter (the latter value is the buffer memory margin). However, only after data is normally recorded is the next data recorded and, if the data fails, data reserved in the buffer memory is re-recorded. Thus, the method just described decreases the effect of buffer memory size since the value stored in the maximum buffer counter is set to a value smaller than the buffer memory size. Furthermore, when recording data from the buffer memory on a disk by means of a disk sequencer, only an amount of data up to the difference between the buffer memory size and the value stored in the maximum buffer counter is available. This causes an additional, remarkable drop in buffer performance.
Therefore, there is a need for the development of a buffer room logic and method for controlling the same which solves the above problem. That is to say, there is a need for the development of a buffer room logic and related method in which the value stored in the buffer counter is altered not during a data write but during a data read since the feature of a data write verification lies in recording next data only after recorded data is verified as normal. Furthermore, there is need for the development of a buffer room logic and related method in which, in order to prevent alteration of the value stored in the buffer counter during a data write process, the buffer room logic should be disabled by the disk interface. In other words, there is a need for the development of a buffer room logic and related method in which data transfer and alteration of the buffer counter contents should be separately controlled by enabling or disabling the buffer room logic in order to implement a data write verification process.
The following patent is considered to be representative of the prior art, and is burdened by the disadvantages set forth herein: U.S. Pat. No. 5,455,954 to Packer, entitled Host Interrupt Signal Generation Circuit For Controlling An Auto Read Operation In A Disk Drive Controller.